package com.klun.spring4.a_oneToThree;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.transaction.annotation.EnableTransactionManagement;


@SpringBootApplication
@EnableTransactionManagement // 启用注解事务管理
public class Application extends SpringBootServletInitializer{//1.配置mvc矿建 继承Springboot的Servlet初始化容器
    public static void main(String[] args) {
        SpringApplication.run(Application.class,args);
    }

    /**
     * 重写 SpringBootServletInitializer 的 configure方法
     * @param application
     * @return
     */

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
        return application.sources(Application.class);
    }
}
